-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Enable versioned docs #1106
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable versioned docs #1106
Conversation
Deploy preview for react-redux-docs ready! Built with commit 8efcb26 |
Sweet! I'll try to take a look at this over the weekend. |
Can it? We have a 5.x branch that we'll keep around for a bit while folks migrate to 6.0. If we can isolate doc versions by branches, that would actually be ideal. |
Oh hey, you did cut a 5.x branch. I wasn't sure that we had one. Per your question: no, I don't think that's how Docusaurus handles things. There's one published site, built from the current Markdown docs files. Older versions of the docs are, I believe, pre-generated HTML files that have been committed (?). But all that has to be on the same branch together, so that it can be copied to the docs build output folder. |
Is there a chance to run some script pre-build that essentially does |
Technically? Probably. But that's really not how DS is meant to work as far as I know, and I don't think it gains us anything useful. |
I think Docusaurus' idea is that it assumes master branch is always
In our case latest version was 5.1.1. master was 6.0, which was also
Yeah I believe so. The generated versioned docs are under the doc site's directory.
I guess nothing would stop us from writing such script by ourselves. We just need to copy over the docs/ and the versioned_sidebars. The header and footer can be a bit off if they're not consistent across versions. And yeah, probably not how Docusaurus is designed to work. |
Thanks for the explanation. In that case, since versioned docs do matter for this project (not so much with Redux, though), I think this looks good. Mark, did you have any further tweaks to make to the base docs before we split out the versions? |
Yeah, gimme another day or two to finish polishing things. |
Any chance we can still get to this? With 7.0 imminent, it's going to be more important. |
I believe so. I'll spend some time this weekend to catch up a bit, update this branch and let's see. |
Hi @timdorr, @markerikson, I've updated this branch and have put v5 to previous version, v6 to stable version, and put up a link to v7 as pre-release version. It should now work under Netlify's preview. Changes
Versioned docs structure.
├── # ... other files
├── docs # pre-release version (v7)
│ ├── README.md
│ ├── api
│ ├── introduction
│ ├── troubleshooting.md
│ └── using-react-redux
└── website
├── # ... other files
├── siteConfig.js
├── versioned_docs # contains stable + previous versions
│ ├── version-5.x # copies docs/ when running docusaurus' version command
│ └── version-6.x
├── versioned_sidebars
│ ├── version-5.x-sidebars.json
│ └── version-6.x-sidebars.json
├── versions.json # list of versioned files
└── yarn.lock Working with versioned docs
|
Oh, this is so good! Thank you! @markerikson Any objections? I'd say just merge this in right now. |
Sure, let's do it! @wgao19 , this is great - thanks! |
* Enable versioned doc * Start adding 6.0 docs * Rename 5.1.1 to 5.x and make it work * Cast v6.x versioned docs * Display v7.x as pre-release version
What does this PR do?
New doc piece regarding #1001:
Enable versioned docs
Summary of the Changes
How to work with versioned docs
Docusaurus assumes that master is the docs for
next
. Oncenext
is released, runyarn version
withinwebsite/
. This copies the diff between current master docs with latest doc site's version to the doc site's created new version.Notes
I've created the 6.0 docs since 6.0 is already released. So for this particular version, we'll need to edit the docs under
website/versioned_docs/version-6.0.0/api/api.md
, etc. In the future, we should edit docs on master, and simply runyarn version
with new version number after release.Docusaurus's versioned docs feature does not assume versioned code. We don't need to keep the code branches of older versions.